using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using StudentManagement.Application.Services;
using System.Reflection;

namespace StudentManagement.Application
{
    public static class DependencyInjection
    {
        public static IServiceCollection AddApplication(this IServiceCollection services)
        {
            // 注册AutoMapper
            services.AddAutoMapper(Assembly.GetExecutingAssembly());

            // 注册所有服务
            services.AddScoped<IStudentService, StudentService>();
            services.AddScoped<ICourseService, CourseService>();
            services.AddScoped<IScoreService, ScoreService>();
            services.AddScoped<IClassService, ClassService>();
            services.AddScoped<IUserService, UserService>();
            services.AddScoped<IRoleService, RoleService>();

            // 如果有其他服务，也可以在这里注册

            return services;
        }
    }
}